const {Article} = require('../../model/article.js');
const pagination = require('mongoose-sex-page');
module.exports = async(req, res) => {
  const page = req.query.page || 1;
  const articles = await pagination(Article).page(page).size(4).display(3).find().populate('author').exec();
  res.render('home/default', articles);
}